<?php

require_once dirname(__FILE__).'/../lib/vehiculoventaadminGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/vehiculoventaadminGeneratorHelper.class.php';

/**
 * vehiculoventaadmin actions.
 *
 * @package    toyomotor
 * @subpackage vehiculoventaadmin
 * @author     Ing. Roberto Hernández De La Luz
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class vehiculoventaadminActions extends autoVehiculoventaadminActions
{
    
    //Metodo new sobreescrito para poder mostrar correctamente el formulario
    
  public function executeNew(sfWebRequest $request)
  {
    $this->form = $this->configuration->getForm();
    //Se reconfigura el form
    $this->form->nuevovv();
    
    $this->vehiculo_venta = $this->form->getObject();
  }
  
  //Metodo new sobreescrito para poder mostrar correctamente el formulario
    public function executeCreate(sfWebRequest $request)
  {
    $this->form = $this->configuration->getForm();
    //Se reconfigura el form
    $this->form->nuevovv();
    
    $this->vehiculo_venta = $this->form->getObject();

    $this->processForm($request, $this->form);

    $this->setTemplate('new');
  }
  
  //Metodo new sobreescrito para poder mostrar correctamente el formulario
    public function executeEdit(sfWebRequest $request)
  {
    $this->vehiculo_venta = $this->getRoute()->getObject();
    $this->form = $this->configuration->getForm($this->vehiculo_venta);
    //Se reconfigura el form
    $this->form->editarvv($this->vehiculo_venta->getAnoModelo()->getIdAno(), $this->vehiculo_venta->getAnoModelo()->getIdModelo());
    
  }
  
  //Metodo new sobreescrito para poder mostrar correctamente el formulario
    public function executeUpdate(sfWebRequest $request)
  {
    $this->vehiculo_venta = $this->getRoute()->getObject();
    $this->form = $this->configuration->getForm($this->vehiculo_venta);
    $this->form->editarvv($this->vehiculo_venta->getAnoModelo()->getIdAno(), $this->vehiculo_venta->getAnoModelo()->getIdModelo());

    $this->processForm($request, $this->form);

    $this->setTemplate('edit');
  }
    
}
